<?php

class ControleurConnexion {

    public function __construct(){

    }

    public function controlConnect($login, $password){
        $cc = ModeleBoutique::getUserByLoginPass($login, $password);
        if ($cc == false){
            return false;
        }else{
            return true;
        }
    }

    public function isAdmin($login, $password){
        $isAdmin = ModeleBoutique::isUserAdmin($login, $password);
        if ($isAdmin == false){
            return false;
        }else{
            return true;
        }
    }

    public function seConnecter($login, $password, $admin){
        $_SESSION['login'] = $login;
        $_SESSION['password'] = $password;
        $_SESSION['admin'] = $admin;
        Panier::initialiser();
    }

    public function seDeconnecter(){
        session_destroy();
    }

} 